package reflect;

import annotation.AutoRunClass;

/**
 * 反射机制访问类上的注解
 */
public class ReflectDemo9 {
    public static void main(String[] args) throws ClassNotFoundException {
        //查看Person类上是否被注解@AutoRunclass标注了
        Class cls = Class.forName("reflect.Person");
        boolean mark = cls.isAnnotationPresent(AutoRunClass.class);
        if (mark){
            System.out.println("被标注了");
        }else {
            System.out.println("没有被标注");
        }
    }
}
